﻿using Basic.FlowRemoteModel.EventTemplate;
using Basic.FlowRemoteModel.EventTemplate.Model;
using Basic.FlowService.Interface;
using WeDonekRpc.Client;
using WeDonekRpc.Client.Interface;

namespace Basic.FlowService.RpcEvent
{
    internal class FlowEventInterEvent : IRpcApiService
    {
        private readonly IFlowEventInterService _Service;

        public FlowEventInterEvent ( IFlowEventInterService service )
        {
            this._Service = service;
        }
        public bool DisableEventInter ( DisableEventInter obj )
        {
            return this._Service.Disable(obj.Id);
        }
        public bool EnableEventInter ( EnableEventInter obj )
        {
            return this._Service.Enable(obj.Id);
        }
        public long AddEventInter ( AddEventInter data )
        {
            return this._Service.Add(data.Datum);
        }

        public void DeleteEventInter ( DeleteEventInter obj )
        {
            this._Service.Delete(obj.Id);
        }

        public EventInterDto GetEventIter ( GetEventIter obj )
        {
            return this._Service.Get(obj.Id);
        }

        public EventInterItem[] GetEventInterItems ()
        {
            return this._Service.GetItems();
        }

        public PagingResult<EventInter> QueryEventInter ( QueryEventInter obj )
        {
            return this._Service.Query(obj.QueryParam, obj.ToBasicPage());
        }

        public bool SetEventInter ( SetEventInter obj )
        {
            return this._Service.Set(obj.Id, obj.Datum);
        }
    }
}
